/**
 *       \file  py_calc_model.h
 *      \brief  Python wrappers for calc_model, calc_model_data
 *     \author  Sergey Miryanov
 *       \date  02.12.2009
 *  \copyright  This source code is released under the terms of 
 *              the BSD License. See LICENSE for more details.
 * */
#ifndef PY_CALC_MODEL_H
#define PY_CALC_MODEL_H

#ifdef BSPY_EXPORTING_PLUGIN

#include "export_python_wrapper.h"

namespace blue_sky {
namespace python  {


	PY_EXPORTER (calc_model_exporter, default_exporter)
      .add_property ("n_phases",    get_n_phases <T>)
      .add_property ("is_water",    get_is_water <T>)
      .add_property ("is_gas",      get_is_gas <T>)
      .add_property ("is_oil",      get_is_oil <T>)
      .add_property ("params",      get_params <T>)
      .add_property ("data",        &T::data)
      .add_property ("saturation",  &T::saturation_3p)
      .add_property ("pressure",    &T::pressure)
      .add_property ("pvt_num",     &T::n_pvt_regions)
      .add_property ("sat_num",     &T::n_sat_regions)
      .add_property ("fip_num",     &T::n_fip_regions)
      .add_property ("scal",        get_scal_3p <T>)
      .add_property ("pvt_regions", &T::pvt_regions)
      .add_property ("sat_regions", &T::sat_regions)
      .add_property ("fip_regions", &T::fip_regions)
      .add_property ("rock_regions",&T::rock_regions)
      .add_property ("pvt_water",   &T::pvt_water_array)
      .add_property ("pvt_gas",     &T::pvt_gas_array)
      .add_property ("pvt_oil",     &T::pvt_oil_array)
    PY_EXPORTER_END;

	template <typename T> int get_n_phases  (T *t) { return t->n_phases; }
    template <typename T> bool get_is_water (T *t) { return t->is_water (); }
    template <typename T> bool get_is_gas   (T *t) { return t->is_gas (); }
    template <typename T> bool get_is_oil   (T *t) { return t->is_oil (); }

	template <typename T>
    smart_ptr <named_pbase, true>
    get_params (T *t)
    {
      return t->ts_params;
    }

    template <typename T>
    smart_ptr <typename T::scal_3p_t, true>
    get_scal_3p (T *t)
    {
      return t->scal_prop;
    }

  /**
   * \brief  Exports wrappers to python
   * */
  void 
  py_export_calc_model ();

} // namespace python
} // namespace blue_sky

#endif
#endif // PY_CALC_MODEL_H
